#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Richard_Kong
from config import config


def common_assert(obj, response, success, code, message, status_code=200):
    obj.assertEqual(status_code, response.status_code)
    obj.assertEqual(success, response.json().get("success"))
    obj.assertEqual(code, response.json().get('code'))
    obj.assertEqual(message, response.json().get('message'))
    if config.user_id:
        obj.assertEqual(config.user_id, response.json().get('data').get('id'))
    else:
        pass
